package locations.actions;

import locations.dao.implement.PracticaDAOHibernateJPA;
import locations.model.Practica;

import com.opensymphony.xwork2.ActionSupport;

public class DeletePracticaAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Long id;

	@Override
	public String execute() throws Exception {
		PracticaDAOHibernateJPA d = new PracticaDAOHibernateJPA();
		Practica p = d.retrieveById(id);
		p.setValido(false);
		d.save(p);
		return SUCCESS;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}


}